package com.ateam.dao.impl;

import org.mybatis.spring.SqlSessionTemplate;

import com.ateam.dao.ActivitiesDao;
import com.ateam.pojo.Activities;

/** 
* @author WuYuan
* 
*/
public class ActivitiesDaoImpl implements ActivitiesDao {
	private SqlSessionTemplate sqlSessionTemplate;
	
	public SqlSessionTemplate getSqlSessionTemplate() {
		return sqlSessionTemplate;
	}

	public void setSqlSessionTemplate(SqlSessionTemplate sqlSessionTemplate) {
		this.sqlSessionTemplate = sqlSessionTemplate;
	}
	
	@Override
	public int addActivity(Activities activity) throws Exception {
		return sqlSessionTemplate.insert("addActivity", activity);
	}

	@Override
	public int addActivitymember(int userid, int activityid) throws Exception {
		Object [] objects =new Object[]{userid,activityid};
		return sqlSessionTemplate.delete("addActivitymember", objects);
	}

}
